<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
   <div id="vue">
       <input type="text" v-model="val">
       {{val|setNumber}}
   </div>
</body>
<script>
    //全局过滤器
//    Vue.filter("setNumber",function (val) {
//        var reg = /[0-5]/g;
//        return val.replace(reg,"6");
//    });
    var vue = new Vue({
        el:"#vue",
        data:{
            val:""
        },
        filters:{
            setNumber:function (val) {
                var reg = /[0-5]/g;
                return val.replace(reg,"6");
            }
        }
    });
</script>
</html>